import 'package:flutter/material.dart';

class AppTheme {
  // 主色
  static const Color primaryColor = Color(0xFFFF5A33);
  
  // 辅助色
  static const Color backgroundColor = Color(0xFFFFF3EB);
  static const Color secondaryColor = Color(0xFFFFD7C5);
  
  // 强调色
  static const Color accentColor = Color(0xFFFF2D55);
  
  // 状态色
  static const Color hoverColor = Color(0xFFFF7652);
  static const Color pressedColor = Color(0xFFFF401A);
  static const Color disabledColor = Color(0xFFFFD1C0);
  
  // 文本颜色
  static const Color textPrimaryColor = Color(0xFF333333);
  static const Color textSecondaryColor = Color(0xFF666666);
  static const Color textLightColor = Color(0xFF999999);
  
  // 其他常用颜色
  static const Color white = Colors.white;
  static const Color black = Colors.black;
  static const Color transparent = Colors.transparent;
  
  // 获取主题数据
  static ThemeData getTheme() {
    return ThemeData(
      primaryColor: primaryColor,
      scaffoldBackgroundColor: backgroundColor,
      appBarTheme: const AppBarTheme(
        backgroundColor: primaryColor,
        foregroundColor: white,
        elevation: 0,
        centerTitle: true,
        titleTextStyle: TextStyle(
          fontSize: 18,
          fontWeight: FontWeight.bold,
        ),
      ),
      colorScheme: const ColorScheme.light(
        primary: primaryColor,
        secondary: secondaryColor,
        onPrimary: white,
        onSecondary: textPrimaryColor,
        background: backgroundColor,
        surface: white,
      ),
      cardTheme: CardTheme(
        elevation: 2,
        shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.circular(12),
        ),
        clipBehavior: Clip.antiAlias,
      ),
      dividerTheme: const DividerThemeData(
        color: Color(0xFFEEEEEE),
        thickness: 1,
        space: 1,
      ),
      elevatedButtonTheme: ElevatedButtonThemeData(
        style: ElevatedButton.styleFrom(
          backgroundColor: primaryColor,
          foregroundColor: white,
          disabledBackgroundColor: disabledColor,
        ),
      ),
      textButtonTheme: TextButtonThemeData(
        style: TextButton.styleFrom(
          foregroundColor: primaryColor,
        ),
      ),
      iconTheme: const IconThemeData(
        color: primaryColor,
      ),
      floatingActionButtonTheme: const FloatingActionButtonThemeData(
        backgroundColor: accentColor,
        foregroundColor: white,
      ),
      tabBarTheme: const TabBarTheme(
        labelColor: white,  // 修改为白色，确保与背景有足够对比度
        unselectedLabelColor: textLightColor,
        indicator: UnderlineTabIndicator(
          borderSide: BorderSide(color: white, width: 2.0),  // 修改指示器颜色为白色
        ),
      ),
    );
  }
}